home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEV
/
A-B
/
002. TESample.cpt
/
TESample.h
< prev
next >
Wrap
Text File
|
1988-08-02
|
6KB
|
143 lines
/*------------------------------------------------------------------------------
#
# Apple Macintosh Developer Technical Support
#
# MultiFinder-Aware TextEdit Sample Application
#
# TESample
#
# TESample.h - Rez Include Source
#
# Copyright © 1988 Apple Computer, Inc.
# All rights reserved.
#
# Versions: 1.0 8/88
#
# Components: TESample.p August 1, 1988
# TESample.c August 1, 1988
# TESample.a August 1, 1988
# TESample.r August 1, 1988
# TESample.h August 1, 1988
# PTESample.make August 1, 1988
# CTESample.make August 1, 1988
#
# TESample is an example application that demonstrates how
# to initialize the commonly used toolbox managers, operate
# successfully under MultiFinder, handle desk accessories and
# create, grow, and zoom windows. The fundamental TextEdit
# toolbox calls and TextEdit autoscroll are demonstrated. It
# also shows how to create and maintain scrollbar controls.
#
# It does not by any means demonstrate all the techniques you
# need for a large application. In particular, Sample does not
# cover exception handling, multiple windows/documents,
# sophisticated memory management, printing, or undo. All of
# these are vital parts of a normal full-sized application.
#
# This application is an example of the form of a Macintosh
# application; it is NOT a template. It is NOT intended to be
# used as a foundation for the next world-class, best-selling,
# 600K application. A stick figure drawing of the human body may
# be a good example of the form for a painting, but that does not
# mean it should be used as the basis for the next Mona Lisa.
#
# We recommend that you review this program or Sample before
# beginning a new application. Sample is a simple app. which doesn’t
# use TextEdit or the Control Manager.
#
------------------------------------------------------------------------------*/
/* these #defines correspond to values in the Pascal source code.
Sample.c includes this file. */
#define kMinSize 40 /* application's minimum size (in K) */
/* we looked at a heap dump while the program was running */
/* it was using about 27K; we added 13K for stack, text & scraps */
#define kPrefSize 60 /* application's preferred size (in K) */
/* we made this (preferred) size bigger than the other (minimum) size */
/* so you can have more text & scraps */
#define rMenuBar 128 /* application's menu bar */
#define rAboutAlert 128 /* about alert */
#define rEditAlert 129 /* edit error alert */
#define rDocWindow 128 /* application's window */
#define rVScroll 128 /* vertical scrollbar control */
#define rHScroll 129 /* horizontal scrollbar control */
/* SysEnvironsVersion is passed to SysEnvirons to tell it which version of the
SysEnvRec we understand. */
#define sysEnvironsVersion 1
/* OSEvent is the event number of the suspend/resume and mouse-moved events sent
by MultiFinder. Once we determine that an event is an osEvent, we look at the
high byte of the message sent to determine which kind it is. To differentiate
suspend and resume events we check the resumeMask bit. */
#define osEvent app4Evt /* event used by MultiFinder */
#define suspendResumeMessage 1 /* high byte of suspend/resume event message */
#define resumeMask 1 /* bit of message field for resume vs. suspend */
#define mouseMovedMessage 0xFA /* high byte of mouse-moved event message */
/* The following constants are used to identify menus and their items. The menu IDs
have an "m" prefix and the item numbers within each menu have an "i" prefix. */
#define mApple 128 /* Apple menu */
#define iAbout 1
#define mFile 129 /* File menu */
#define iNew 1
#define iClose 4
#define iQuit 12
#define mEdit 130 /* Edit menu */
#define iUndo 1
#define iCut 3
#define iCopy 4
#define iPaste 5
#define iClear 6
/* ExtremeNeg and ExtremePos are used to set up wide open rectangles and regions. */
#define extremeNeg -32768
#define extremePos 32767 - 1 /* required to address an old region bug */
/* TextMargin is the number of pixels we leave blank at the edge of the window. */
#define textMargin 2
/* MaxOpenDocuments is used to determine whether a new document can be opened
or created. We keep track of the number of open documents, and disable the
menu items that create a new document when the maximum is reached. If the
number of documents falls below the maximum, the items are enabled again. */
#define maxOpenDocuments 1
/* MaxDocWidth is an arbitrary number used to specify the width of the TERec's
destination rectangle so that word wrap and horizontal scrolling can be
demonstrated. */
#define maxDocWidth 576
/* MinDocWidth is used to limit the minimum dimension of a window when GrowWindow
is called. */
#define minDocDim 64
/* MaxTELength is an arbitrary number used to limit the length of text in the TERec
so that various errors won't occur from too many characters being in the text. */
#define maxTELength 32000
/* ControlInvisible is used to 'turn off' controls (i.e., cause the control not
to be redrawn as a result of some Control Manager call such as SetCtlValue)
by being put into the contrlVis field of the record. ControlVisible is used
the same way to 'turn on' the control. */
#define controlInvisible 0
#define controlVisible 0xFF
/* ScrollBarAdjust, GrowBoxAdjust, and ScrollBar width are used in calculating
values for control positioning and sizing. */
#define scrollbarAdjust 15
#define growboxAdjust 13
#define scrollbarWidth 16
/* CrCharacter is used to compare for a carriage return when calculating the
number of lines in the TextEdit record. */
#define crCharacter 13
/* ButtonScroll is how many pixels to scroll horizontally when the button part
of the horizontal scrollbar is pressed. */
#define buttonScroll 4